"""
数据库备份工具的setup.py配置文件

用于打包和分发数据库备份工具。
"""

from setuptools import setup, find_packages
import os

# 读取README文件内容
with open("README.md", "r", encoding="utf-8") as fh:
    long_description = fh.read()

# 读取requirements.txt文件
with open("requirements.txt", "r", encoding="utf-8") as f:
    requirements = [line.strip() for line in f if line.strip() and not line.startswith("#")]

setup(
    name="database-backup-tool",
    version="1.0.0",
    author="数据库备份工具开发团队",
    author_email="liumou.site@qq.com",
    description="支持MySQL、MariaDB、PostgreSQL的数据库备份工具，提供差异检查和Git上传功能",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://gitee.com/liumou_site/database-backup",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Topic :: Database",
        "Topic :: System :: Archiving :: Backup",
        "Topic :: Utilities",
    ],
    python_requires=">=3.7",
    install_requires=requirements,
    extras_require={
        "dev": [
            "pytest>=6.0",
            "pytest-cov>=2.0",
            "black>=21.0",
            "flake8>=3.9",
            "mypy>=0.910",
        ],
        "mysql": ["PyMySQL>=1.0.0"],
        "postgresql": ["psycopg2-binary>=2.9.0"],
        "git": ["GitPython>=3.1.0"],
    },
    entry_points={
        "console_scripts": [
            "dbbackup=database_backup.cli:main",
        ],
    },
    include_package_data=True,
    package_data={
        "database_backup": ["*.md", "*.txt"],
    },
    keywords=[
        "database", "backup", "mysql", "mariadb", "postgresql", 
        "git", "diff", "comparison", "export"
    ],
    project_urls={
        "Documentation": "https://gitee.com/liumou_site/database-backup/wiki",
        "Source": "https://gitee.com/liumou_site/database-backup",
        "Bug Reports": "https://gitee.com/liumou_site/database-backup/issues",
    },
)